import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)   //  扩展vue-router插件


//  设置路由列表
const  routes = [
    {
        path:'/',
        redirect:'/hello'
    },
    {
        path:'/hello',
        component: ()=>import('@/view/HelloWorld.vue'),
        name:'hello'
    },
    {
        path:'/login',
        component: ()=>import('@/view/LoginView.vue'),
        name:'login'
    },
    {
        path:'/register',
        component: ()=>import('@/view/RegisterView.vue'),
        name:'register'
    },
    {
        path:'/index',
        component: ()=>import('@/view/Index.vue'),
        name:'index'
    }

]


// 创建路由对象

const  router  = new VueRouter({
    routes
})


// 导出路由
export  default  router